#!/bin/bash
######################
# elk 下载并安装
# elk_init.sh
#
# author:angy.zhang
# mail: zdy410291479@gmail.com
# link： www.hiext.com
#
#####################

init_user_dir(){
mkdir data
mkdir software
cd  ./data
mkdir nginx
mkdir logs
}


install_jdk(){
cd ~
java -version 
if [ $? -eq 0 ];then
    echo "jdk had installed !!!"
    return 1
else
    cd ~/software
    wget https://youpin-file.oss-cn-shenzhen.aliyuncs.com/software/jdk-8u251-linux-x64.tar.gz
    tar -xvzf jdk-8u251-linux-x64.tar.gz
    mv jdk1.8.0_251 jdk1.8.0
    rm -f jdk-8u251-linux-x64.tar.gz
    echo "export JAVA_HOME=~/software/jdk1.8.0">>~/.bash_profile
    echo "export PATH=\$JAVA_HOME/bin:\$PATH">>~/.bash_profile
    echo "export CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tool.jar">>~/.bash_profile
    source .bash_profile
    return 1
fi
}

download_software(){
    cd ~
    lsof -i:9200
}

#init_user_dir
#install_jdk
#download_software